]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Check that no new term was introduced before doing a subsearch
authorMarina Zhurakhinskaya <marinaz@redhat.com>
Mon, 5 Oct 2009 17:50:58 +0000 (13:50 -0400)
committerMarina Zhurakhinskaya <marinaz@redhat.com>
Mon, 5 Oct 2009 17:50:58 +0000 (13:50 -0400)
We combine search terms with OR, so if a new search term is introduced,
the search results are no longer a subset of the previous search results.

js/ui/genericDisplay.js

index e15df20a47ab0f53d9ff178970f0ddbd832c716a..cbd211fb01b192c75097678d08de995e25d7cab5 100644 (file)
@@ -370,7 +370,11 @@ GenericDisplay.prototype = {
             return;
         let flags = RedisplayFlags.RESET_CONTROLS;
         if (this._search != '') {
-            if (lowertext.indexOf(this._search) == 0)
+            // Because we combine search terms with OR, we have to be sure that no new term
+            // was introduced before deciding that the new search results will be a subset of
+            // the existing search results.
+            if (lowertext.indexOf(this._search) == 0 &&
+                lowertext.split(/\s+/).length == this._search.split(/\s+/).length)
                 flags |= RedisplayFlags.SUBSEARCH;
         }
         this._search = lowertext;